import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout/index'

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    name: '',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('../views/Home.vue'),
        meta: {
          title: '首页'
        }
      },
      {
        path: 'login',
        name: 'login',
        component: () => import('../views/login/index.vue'),
        meta: {
          title: '登录'
        }
      },
      {
        path: 'register',
        name: 'register',
        component: () => import('../views/login/register.vue'),
        meta: {
          title: '注册'
        }
      },
      {
        path: 'cart',
        name: 'cart',
        component: () => import('../views/cart/index.vue'),
        meta: {
          title: '购物车'
        }
      },
      {
        path: 'brand',
        name: 'brand',
        component: () => import('../views/brand-zone/index.vue'),
        meta: {
          title: '品牌专区'
        }
      },
      {
        path: 'brandId',
        name: 'brand-list',
        component: () => import('../views/brand-list/index.vue'),
        meta: {
          title: '品牌列表'
        }
      },
      {
        path: 'coupon',
        name: 'coupon',
        component: () => import('../views/coupon/coupon.vue'),
        meta: {
          title: '领券中心'
        }
      },
      {
        path: 'select',
        name: 'select',
        component: () => import('../views/product-select/index.vue'),
        meta: {
          title: '产品选型'
        }
      },
      {
        path: 'selector',
        name: 'selector',
        component: () => import('../views/product-selector/index.vue'),
        meta: {
          title: '专业选型'
        }
      },
      {
        path: 'detail/:id',
        name: 'product-detail',
        component: () => import('../views/product-detail/index.vue'),
        meta: {
          title: '商品详情'
        }
      },
      {
        path: 'contract',
        name: 'contract',
        component: () => import('../views/contract/index.vue'),
        meta: {
          title: '合同'
        }
      },
      {
        path: 'pay/:id',
        name: 'pay',
        component: () => import('../views/pay/index.vue'),
        meta: {
          title: '我的购物车'
        }
      },
      {
        path:'sellerHome',
        name:'sellerHome',
        component:() => import('../views/sellerHome/index.vue'),
        meta:{
          title:'卖家店铺'
        }
      },
      {
        path: 'logistics/:id',
        name: 'logistics',
        component: () => import('../views/logistics/index.vue'),
        meta: {
          title: '支付成功详情'
        }
      },
      {
        path: 'check',
        name: 'check',
        component: () => import('../views/check/index.vue'),
        meta: {
          title: '我的购物车'
        }
      },
      {
        path: 'my',
        name: 'my',
        component: () => import('../views/my/index.vue'),
        meta: {
          title: '我的'
        },
        children: [
          {
            path: 'me',
            name: 'me',
            component: () => import('../views/my/view/rt-index.vue'),
            meta: {
              title: '我的'
            }
          },
          {
            path: 'order',
            name: 'order',
            component: () => import('../views/my/view/rt-order.vue'),
            meta: {
              title: '我的订单'
            }
          },
          {
            path: 'order-detail/:id',
            name: 'order-detail',
            component: () => import('../views/my/view/rt-order-detail.vue'),
            meta: {
              title: '我的订单'
            }
          },
          {
            path: 'price',
            name: 'price',
            component: () => import('../views/my/view/rt-price.vue'),
            meta: {
              title: '我的询询价单'
            }
          },
          {
            path: 'shipments',
            name: 'shipments',
            component: () => import('../views/my/view/rt-shipments.vue'),
            meta: {
              title: '我的发货单'
            }
          },
          {
            path: 'collect',
            name: 'collect',
            component: () => import('../views/my/view/rt-collect.vue'),
            meta: {
              title: '我的收藏'
            }
          },
          {
            path: 'coupons',
            name: 'coupons',
            component: () => import('../views/my/view/rt-coupon.vue'),
            meta: {
              title: '我的优惠券'
            }
          },
          {
            path: 'history',
            name: 'history',
            component: () => import('../views/my/view/rt-history.vue'),
            meta: {
              title: '我的历史'
            }
          },
          {
            path: 'news',
            name: 'news',
            component: () => import('../views/my/view/rt-news.vue'),
            meta: {
              title: '推送消息'
            }
          },
          {
            path: 'feedback',
            name: 'feedback',
            component: () => import('../views/my/view/rt-feedback.vue'),
            meta: {
              title: '意见反馈'
            }
          },
          {
            path: 'VerifiedMember',
            name: 'VerifiedMember',
            component: () => import('../views/my/view/rt-VerifiedMember.vue'),
            meta: {
              title: '会员认证'
            }
          },
          {
            path: 'detail',
            name: 'detail',
            component: () => import('../views/my/view/rt-detail.vue'),
            meta: {
              title: '账户绑定'
            }
          },
          {
            path: 'safe',
            name: 'safe',
            component: () => import('../views/my/view/rt-safe.vue'),
            meta: {
              title: '安全认证'
            }
          },
          {
            path: 'address',
            name: 'address',
            component: () => import('../views/my/view/rt-address.vue'),
            meta: {
              title: '收货地址'
            }
          },
          {
            path: 'psw',
            name: 'psw',
            component: () => import('../views/my/view/rt-psw.vue'),
            meta: {
              title: '修改密码'
            }
          },
          {
            path: 'changeBind',
            name: 'changeBind',
            component: () => import('../views/my/view/rt-changeBind.vue'),
            meta: {
              title: '修改绑定'
            }
          }
        ]
      },
      {
        path: 'selleru',
        name: 'selleru',
        component: () => import('../views/seller/index'),
        meta: {
          title: '卖家'
        },
        children:[
          {
            path:'se_center',
            name:'se_center',
            component:() => import('../views/seller/views/seller_center'),
            meta:{
              title:'卖家中心'
            }
          },
          {
            path:'se_order',
            name:'se_order',
            component:() => import('../views/seller/views/seller_order'),
            meta:{
              title:'我的订单'
            }
          },
          {
            path:'new_goods',
            name:'new_goods',
            component:() => import('../views/seller/views/new_goods'),
            meta:{
              title:'新增商品'
            }
          },
          {
            path:'are_sales',
            name:'are_sales',
            component:() => import('../views/seller/views/are_sales'),
            meta:{
              title:'正在销售'
            }
          },
          {
            path:'bulk_import',
            name:'bulk_import',
            component:() => import('../views/seller/views/bulk_import'),
            meta:{
              title:'批量导入'
            }
          },
          {
            path:'quotation_prices',
            name:'quotation_prices',
            component:() => import('../views/seller/views/quotation_prices'),
            meta:{
              title:'询货报价'
            }
          },
          {
            path:'inquiry_results',
            name:'inquiry_results',
            component:() => import('../views/seller/views/inquiry_results'),
            meta:{
              title:'询货结果'
            }
          },
          {
            path:'basic_setup',
            name:'basic_setup',
            component:() => import('../views/seller/views/basic_setup'),
            meta:{
              title:'基本设置'
            }
          },
          {
            path:'clerk_management',
            name:'clerk_management',
            component:() => import('../views/seller/views/clerk_management'),
            meta:{
              title:'店员管理'
            }
          },
          {
            path:'corporate_communication',
            name:'corporate_communication',
            component:() => import('../views/seller/views/corporate_communication'),
            meta:{
              title:'公司信息'
            }
          },
          {
            path:'apply_for',
            name:'apply_for',
            component:() => import('../views/seller/views/apply_for'),
            meta:{
              title:'申请商铺'
            }
          },
          {
            path:'shipping_address',
            name:'shipping_address',
            component:() => import('../views/seller/views/shipping_address'),
            meta:{
              title:'收货地址管理'
            }
          },
          {
            path:'customs_invoice',
            name:'customs_invoice',
            component:() => import('../views/seller/views/customs_invoice'),
            meta:{
              title:'开票信息'
            }
          },
          {
            path:'contact_information',
            name:'contact_information',
            component:() => import('../views/seller/views/contact_information'),
            meta:{
              title:'个人信息'
            }
          },{
            path:'change_password',
            name:'change_password',
            component:() => import('../views/seller/views/change_password'),
            meta:{
              title:'修改密码'
            }
          },{
            path:'cost_query',
            name:'cost_query',
            component:() => import('../views/seller/views/cost_query'),
            meta:{
              title:'费用查询'
            }
          },{
            path:'order_details/:id',
            name:'order_details',
            component:() => import('../views/seller/views/order_details'),
            meta:{
              title:'订单详情'
            }
          },
        ]
      },
      {
        path: 'bulletin',
        name: 'bulletin',
        component: () => import('../views/bulletin/index.vue'),
        meta: {
          title: '公告详情'
        }
      }
    ]
  },
  {
    path: '/demo',
    name: 'demo',
    component: () => import('../views/demo/index.vue')
  }
]

const router = new VueRouter({
  base: process.env.BASE_URL,
  routes
})
export default router
